﻿using Compass.Wasm.Shared;
using System.Collections.Generic;

namespace Compass.Wpf.ApiServices.Plans;
public interface IFinishGoodsCountService:IBaseService<FinishedGoodsCountDto>
{
    Task<ApiResponse<List<FinishedGoodsCountDto>>> GetAllWithFeeAsync(bool showAll);
}
public class FinishGoodsCountService:BaseService<FinishedGoodsCountDto>,IFinishGoodsCountService
{
    #region ctor
    private readonly HttpRestClient _client;
    private const string ServiceName = "FinishedGoodsCount";
    public FinishGoodsCountService(HttpRestClient client) : base(client, ServiceName)
    {
        _client = client;
    }
    #endregion

    #region 扩展查询
    public async Task<ApiResponse<List<FinishedGoodsCountDto>>> GetAllWithFeeAsync(bool showAll)
    {
        var request = new BaseRequest
        {
            Method = RestSharp.Method.Get,
            Route = $"api/{ServiceName}/All/WithFee?showAll={showAll}"
        };
        return await _client.ExecuteAsync<List<FinishedGoodsCountDto>>(request);
    }
    #endregion
}